<template>
    <div>
        <h2>欢迎访问蜗牛书城后台管理系统</h2>
        {{$store.state.name}}--{{$store.state.age}}--{{$store.state.counter}} -- {{$store.getters.changeCount}}
        -- {{$store.state.msg}} -- {{$store.getters.test01}}

        <p>欢迎您 :{{$store.state.username}}</p>
        <button @click="test01">ADD COUNT</button>  <p />

        <button @click="test02">TestAction</button>

        <hr />
        {{$store.state.a.city}} ==== {{$store.state.b.province}}   <p />

        <button @click="test03">AAAAAAAAAAAAA</button>
    </div>
</template>

<script>
    export default {
        name: "WelCome" ,
        methods:{
          test01(){
            this.$store.commit("addCount",10);
          },
          test02(){
            this.$store.dispatch("updateCount",50);
          },
          test03(){
            this.$store.commit("changeCity");
          }
        }
    }
</script>

<style scoped>

</style>